package net.zoneland.knowledge.enums;

/**
 * 纠错类型.
 *
 * @author: zmq
 * 2021/9/29
 */
public enum AttachTypeEnum {
    /**
     * REFERENCE.
     */
    REFERENCE("REFERENCE", "参考附件"),
    /**
     * TEMPLATE.
     */
    TEMPLATE("TEMPLATE", "模板附件"),
    /**
     * MERGE.
     */
    MERGE("MERGE", "合并报表附件"),
    /**
     * RESULT.
     */
    RESULT("RESULT", "结果附件"),

    /**
     * CHAPTER_FILE.
     */
    CHAPTER_FILE("CHAPTER_FILE", "用章申请附件"),

    /**
     * SECRETARY_FILE.
     */
    SECRETARY_FILE("SECRETARY_FILE", "书记项目附件");

    /**
     * 构造.
     * @param value key
     * @param name value
     */
    AttachTypeEnum(final String value, final String name) {
        this.value = value;
        this.name = name;
    }
    /**
     * key.
     */
    private String value;

    /**
     * label.
     */
    private String name;

    /**
     * .
     *
     * @return value
     */
    public String getValue() {
        return value;
    }

    /**
     * .
     *
     * @return name
     */
    public String getName() {
        return name;
    }

    /**
     * 根据key获取枚举对象.
     * @param value key
     * @return 枚举值
     */
    public static AttachTypeEnum getByValue(String value) {
        for (AttachTypeEnum categoryEnum : AttachTypeEnum.values()) {
            if (categoryEnum.value.equals(value)) {
                return categoryEnum;
            }
        }
        return null;
    }

}
